#include <QtGui/QApplication>
#include <QDeclarativeEngine>
#include <QDeclarativeContext>
#include <QtDeclarative>
#include "qmlapplicationviewer.h"
#include "engine.h"
//#define SPLASH_SCREEN
#ifdef SPLASH_SCREEN
#include <MDeclarativeCache>
#endif

int main(int argc, char *argv[])
{
    Engine* engine = new Engine;

#ifdef SPLASH_SCREEN
    QApplication *app = MDeclarativeCache::qApplication(argc, argv);
    QDeclarativeView *viewer = MDeclarativeCache::qDeclarativeView();
//    viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer->rootContext()->setContextProperty("engine", engine);
    viewer->setSource(QUrl::fromLocalFile(QLatin1String("qml/colorlinze/main.qml")));
    viewer->showFullScreen();
#else
    QApplication app(argc, argv);
    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.rootContext()->setContextProperty("engine", engine);
    viewer.setMainQmlFile(QLatin1String("qml/colorlinze/main.qml"));
    viewer.showExpanded();
#endif

    return app.exec();
}
